package com.dalin.platform.loa.action;

import com.dalin.common.utils.StringUtils;
import com.dalin.framework.action.StrutsTwoAction;
import com.dalin.platform.loa.service.WsSecurityService;
import com.dalin.platform.loa.vo.LoginVo;
import com.dalin.platform.loa.vo.WsCurrentUserInfo;

/*****************************************************************************
 * @content: 修改密码                                                                                                                              *
 * @author : 那建林                                                                                                                                 *
 * @crtDate: 2010-06-14                                                     *
 ****************************************************************************/
public class ModifyPswdAction extends StrutsTwoAction {
	private WsSecurityService wsSecurityService;
	private LoginVo vo;
	
	public String execute() throws Exception {
		super.printInfo("", "===== this action begin");
		WsCurrentUserInfo cui = getCurrentUser();
		String info = wsSecurityService
				.modifyUserPswd(cui.getUserId(), 
						vo.getOriginalLoginPswd(),
						vo.getLoginPswd());
		if (StringUtils.isBlank(info)) {
			setResContent(true, "");
		} else {
			setResContent(false, info);
		}
		super.printInfo("", "===== this action end");
		return null;
	}

	public WsSecurityService getWsSecurityService() {
		return wsSecurityService;
	}
	public void setWsSecurityService(WsSecurityService wsSecurityService) {
		this.wsSecurityService = wsSecurityService;
	}
	public LoginVo getVo() {
		return vo;
	}
	public void setVo(LoginVo vo) {
		this.vo = vo;
	}
}
